# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.NetworkServices.V1.Model.WasmPluginVersionDetails do
  @moduledoc """
  Details of a `WasmPluginVersion` resource to be inlined in the `WasmPlugin` resource.

  ## Attributes

  *   `createTime` (*type:* `DateTime.t`, *default:* `nil`) - Output only. The timestamp when the resource was created.
  *   `description` (*type:* `String.t`, *default:* `nil`) - Optional. A human-readable description of the resource.
  *   `imageDigest` (*type:* `String.t`, *default:* `nil`) - Output only. The resolved digest for the image specified in `image`. The digest is resolved during the creation of a `WasmPluginVersion` resource. This field holds the digest value regardless of whether a tag or digest was originally specified in the `image` field.
  *   `imageUri` (*type:* `String.t`, *default:* `nil`) - Optional. URI of the container image containing the Wasm module, stored in the Artifact Registry. The container image must contain only a single file with the name `plugin.wasm`. When a new `WasmPluginVersion` resource is created, the URI gets resolved to an image digest and saved in the `image_digest` field.
  *   `labels` (*type:* `map()`, *default:* `nil`) - Optional. Set of labels associated with the `WasmPluginVersion` resource.
  *   `pluginConfigData` (*type:* `String.t`, *default:* `nil`) - Configuration for the plugin. The configuration is provided to the plugin at runtime through the `ON_CONFIGURE` callback. When a new `WasmPluginVersion` version is created, the digest of the contents is saved in the `plugin_config_digest` field.
  *   `pluginConfigDigest` (*type:* `String.t`, *default:* `nil`) - Output only. This field holds the digest (usually checksum) value for the plugin configuration. The value is calculated based on the contents of the `plugin_config_data` field or the container image defined by the `plugin_config_uri` field.
  *   `pluginConfigUri` (*type:* `String.t`, *default:* `nil`) - URI of the plugin configuration stored in the Artifact Registry. The configuration is provided to the plugin at runtime through the `ON_CONFIGURE` callback. The container image must contain only a single file with the name `plugin.config`. When a new `WasmPluginVersion` resource is created, the digest of the container image is saved in the `plugin_config_digest` field.
  *   `updateTime` (*type:* `DateTime.t`, *default:* `nil`) - Output only. The timestamp when the resource was updated.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :createTime => DateTime.t() | nil,
          :description => String.t() | nil,
          :imageDigest => String.t() | nil,
          :imageUri => String.t() | nil,
          :labels => map() | nil,
          :pluginConfigData => String.t() | nil,
          :pluginConfigDigest => String.t() | nil,
          :pluginConfigUri => String.t() | nil,
          :updateTime => DateTime.t() | nil
        }

  field(:createTime, as: DateTime)
  field(:description)
  field(:imageDigest)
  field(:imageUri)
  field(:labels, type: :map)
  field(:pluginConfigData)
  field(:pluginConfigDigest)
  field(:pluginConfigUri)
  field(:updateTime, as: DateTime)
end

defimpl Poison.Decoder, for: GoogleApi.NetworkServices.V1.Model.WasmPluginVersionDetails do
  def decode(value, options) do
    GoogleApi.NetworkServices.V1.Model.WasmPluginVersionDetails.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.NetworkServices.V1.Model.WasmPluginVersionDetails do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
